<!DOCTYPE html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  
 </head>
 <body>
  <script>
 var mycars = ["Saab","Volvo","BMW"];
    var car = mycars.splice(1,2);     	//从索引1的位置上删除两个元素
    document.write(car);                	//打印出删除出的元素
    document.write('<br/>');
    document.write(mycars);             	//打印出原数组中剩下的元素

  </script>
 </body>
</html>
